Changed main interface
Updated examples and README to fit the new API