Example and logic

Some important logic changes and exaple page.