reverse loop gives cleaner code