Save code cleaned up and comments added. Still buggy if panels added too quickly.