changing interface to take input from stdin
remove a few obsolete lines