changed stuff to pointers because nil is good when things go wrong
updated tests