updated checktetris algorithm