better performance output
made num loops controllable.