more dynamic

Replaced a few constants with "sizeof" methods to make the code more
dynamic.
Merge pull request #4 from kjgregory/master

more dynamic code