redesigned class structure, has a working solution
added comments