rewrite solver so it can be used both for population and single solution based algorithms