Adding logic to view notes