Added example webpage and corrected some logic