Rewrite bankers method, was copy from reference