Finished implementing prim procedures for math