got rid of do loop