Calc path bounds code moved to func