More memory efficient, don't copy data
Removed unecessary copying of daya