Added zero copy code, improve performance