final commit. code is fully commented and working