fixed progress grid and made code more efficient