Removed console.log & cleaned up code slightly