added remaining functionality. code review pending