Optmize, use size_t instead of magic num