please find my example here with a complete documentation. this one will hopefully explain everthing.