Added full logic structure with console.log to test eachs tep
Removed console log statements for testing. Testing complete