initial logic for view distance
more logic for view distance