A few functions to help ease some common calculations