improve viewing algorithm