added a simple example
fixed bug if no method was given