Added in a lot of helper functions