incrementally calculate constraints. still buggy.