finishing switch to malloc
Initial commit. Structure created from script