fixed some more type checking, problem with pointers also multiplication is segfaulting now