finished the 4th C assignment (submitted version)