a small optimisation + more tests