first pass of working functions