More code for selecting and calculating.