still needs updating, need to figure out second loop