reorganized previous calculation, should be faster now
Authored by: juliakern 2014-01-31
Parent: [r27767]
Child: [r27769]