UNTESTED but wrote code for everything except printing out at the end