Clean up and commenting of the code.