coding for second view