modified code in a good way:)