Please edit your question and split your message to different sentences. Currently this worm is not meaningful:
"please tell me why I want to capture 6 faces of rubik..." - How could I tell you, why you want this?
Explain exactly,what the problem is and where you assume the cause in the long code. focus on the relevant part of the code to increase the chance to get an answer in the forum. It is not likely that the readers dig in 209 lines of code to find out, what your problem might be.