Added locals calculation