moved functions from data
cleaned up the code, added docstring, removed functions that belong into date.py