changed: changed for loops to take advantage of cool julia features