give viewer its own function