Added functors and updated to fit with the new ojquery