a lot of cases need to be considered
simple dp