cleanup (charbuffer, xbuffer, width)

remove unused variables and clean-up for-loop