First version of compose
tidied compose() and added more tests