first attempt at full functionality