Assignment 2B of Comp333