need help as iam newbee this programe is hanging on the middlle some times runs

please reply for correct procedure to reduce braces