what the? This is way too long. Not only many of the calculations can be put directly into the return hash, there’s so many different values returned it’s ridiculous. Who the heck is going to read that AP gain spreadsheet anyway?!