added example1 as a test and corrected it's behavior