cleaned up dead code and made changes @seansaleh suggested