more error checking and comments. remove unnecessary files. add gitignore