stupid malloc leaks sort of fixed