Updated setLevel function to return this object.