This compiles and seems to be correct