bug fixes, added some documentation and renamed files to be more specific