Put home calculations into their own function so they may be unit tested