add assignment 2 utility and reorganize