changed most myallocs back to malloc