feh... needs cleanup and testing
cleanup of panel error correction function
panel functions mostly working, needs cleanup and additional testing