seg faults on inputs less than 7 and greater than 56