Got loops, variables and measureLen working