updated bucket creation algo