refactor and looping

UI might need some polish from @ejohnson44 but it works