Cleaned up formatting, added better commenting