removed all mallocs