initial code base, still contains a bug where the constraint solver could not find a solution for some cases