Use `peek` instead of `last` to vector
Remove wordy calculation
Add primitive hints
Merge remote-tracking branch 'origin/bai-improve'