took out console.log statements, fix initialization algorithm