Added dim function as well.  The programs gets to all the correct functions but the pieceswon't dim or turn off for some reason.