adds new version of solving the pigeon problem