Cleaned up calculateBarX params.