adding exceptions, removing unused code, edits overall