A construction of p-local H-spaces