really clean up really hard. fix some memory leaks.