adding tests and closure for binding functionality