improved view.php