clean up variable declarations, change final return to a console.log