I think this finishes an initial implementation, now to compile and test
fixed syntax