got rid of break statements for clarity