revamped update page logic for proper math using 'parseInt'