N*2 memory instead of N^2.