cleaned up code and removed console.logs