with these changes the code compiles