removed console logs and cleaned up code