partial efforts in rewriting basic functionalities of will_paginate