Solved TapeEquilibrium in C