Cleaned up and commented code and made minor edits to README