Fix #8: Change internal data representation to function
Merge pull request #9 from gzm0/data-layout

Fix #8: Change internal data representation to function