implemented compose; fixed bug