implemented generic read and write functions to illustrate visibility