class path errors fixed, code changed to make it functional