Not sure why the compilation is failing but this seems to work