Naive implementation of size method
Refactor size to be constant-time.