equation data entry mostly working. code tidy.