now using a buffer of bytes for all lp data
changed serialize functions to take a void* buffer
code that can work