fully commented, about to attempt extra credit