update code - remove debug code and increase pagination