panels working and some code optimizing