finally a working solution to the composition problem