bind vs lambda
updated to more generic type names
fixed error in lambda expression