fix syntax errors
fix some bugs
check to make sure adjacent cells are open first