improved memory estimate. now using memcpy for string.
added profiling utilities.
experiment with memset.
made code more explicit.