Added docstrings, indent using spaces, cleanup code
added LICENSE