compiles, but some bugs need fixed