fixed bugs so code will compile