added most view logic