took out the loop that was causing the seg faults -- stupid quadruple nested loops