start of major code refactor. auto looping