Extracted code in update() function to separate functions
Page turn animation now works