INFO247 - Lab 6 - #5 All from scratch (full code)