streamlined, added comments, and changed init to use