adding onDemand feature and allowing method feature parameter to be a function
0.2.0