added ar
made function and added iteration start