Cleaned up code, added documentation
Cleaned up code, added documentation