starting to implement forward-checking; will need refactoring later