tutorial4 with errors fixed and with generic views