added check that light cycles aren't at borders