removed annoying print statement
better logic checks