Two boy scouts were selling popcorn for a fundraiser at a local grocery store and made $640. They sold twice the amount of kettle corn as butter popcorn, and 6 more bags of cheddar popcorn than kettle corn. If kettle corn cost $15 a bag, butter popcorn cost $8 per bag, and cheddar popcorn cost $10 per bag, how much of each type of popcorn did they sell? Write an equation to solve the problem.