CS6102 assignment 2