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