can compile, still some minor errors in math