optimize.. less malloc.