implementation using object, changed the whole approach