working currently

about to rewrite all the looping code