used break instead of inconsistent return points