Adding view logic