start of transition to chris's code