Needs to become object oriented