simplified code, changed varnam x to xs, added pluck, fixed bug in compose]