nit let's re order in the if too