removed logic loop and updated formatting