adding some functional example (quick and dirty). PENDING: refactor this mess.