added another challenge
improved the update method