Cleaned up files, added comments and fixed indentation