a small module for pagination algorithms