added break statement, cleaned up syntax