fixed periodic boundary bug in rules, tested and fixed monolayer