sorted out the if loop