added optimizations.get_ranges function
added some methods to classes from data_structures.py