doing the final distribution part