code compiles and runs on macbook