updated viewer to actually work; added more functionality