Jack and I fixed reference bugs and added correct functionality