refactored.

reanmed some stuff. updated example.