Assignment 6: finished all basic functionalities