help make this program more efficient