New: better documentation!

Removed some unused variables/cleaned up some code as well.