added gitignore, made some nice error checking and split off stuff into a module