added comments, cleaned code and bumped to v1