Adding comments and cleaning up variables