Updated to use object variables