finished stability(); moved stable tiles to a separate function