compiles and runs, but incorrectly