Pieces functionality idea fully commented.