almost finished with loops