Added a callback option.

Merge before #22