the diag problem again, stupid algorithm using flood-fill, there are more decent relation in equations, learn it. keep working