Fixed redundant code; keep testing; work on finding complex solutions