added random expansion loop