implemented samebasis and isdual, still need to refactor codebase with them in mind though