homework 2: 
- add Write & View funtion
- add try - catch block