Implemented range module

Added some auxiliary functions