clean up looping and vector construction #26