i was referencing malloced functions from unmalloced pointers
I had some faulty boolean algebra leading me to make mistakes with the assignments, now should be working