removed unnecesary loop