added most of the helper functions. inverting a matrix works. still a lot to do