Updated a bit, but need to remove 'function' from in front of a few methods in order to run them on a mac