small cleanup, replaced scanf with getchar()