Updated to Object Oriented code