Resolves #23.

* Fixed an issue with preserving the array keys
Added missing method calculateSize.
Merge pull request #25 from frmwrk123/fix/23

Resolves #23.