move stuff around, fix the >>2 mistake, add a test