fixing code to be more clear