use object and for loop