All round logic ready to test. Everything appears in console and input taken from there.