nal building code, a lot of changes
freeing buffers