re-implemented some helper methods. STill needs a lot of work