Drastically simplified availablePieces with class bitfield. Tested and fixed the runloop.