made the code clearer
keeping the code provided, for bugchecking purposes