Cleaned up code
Commented and cleaned up code