Solution for last SWE 645 assignment