Renamed helper functions for accuracy. Minor formatting.