Sorry for the late reply @Rodrigo , was busy improving the code so that it translates well to what i want to do with the book tho its still buggy as heck.
Reason is that i want make an if condition is that i want to add additional animations inside each page, tho i must admit I'm not good at creating a dynamic function for that. Based on what you're saying is that i should leave the PAGES function as it is and just do my other animation separately?