Created dirty version of withdrawal type algorithm