added geometry examples - fixed bugs in rewrite rules