added comment and a couple of missing break statements