fixed some math, though planes don't seem to work at all now