added tons o comments and fixed bugs related to first and last runs of true/false in x
why does it still say modified??