add error checking, clean up memset and types
remove objs