Cleaned up console.log
Added tests to cover