fixed a few problems, but still doesn't compile