Use jQuery $.inArray instead of indexOf
Separate call to user callback in another function
Version 0.0.9