got rid of head malloc