Add comments, clean out old code

Cleaner code, less unused functions, comments