starting to move code around, this works so far.