printfs replaced with write for all local commands
fixed issue where previous results would stay in the buffer array