updated to fit class approach