Removed buffer overrun error (incrementing output pointer one time too