renamed some loop_ vars and cleaned up can buf