Fixed aggregation/routing bug by flipping input arrays vertically