first attempt at class based coding