It compiles at least
A little cleanup
It may work