added conversion to and from base 10
probably leaks memory. probably slow as hell. but it probably does the job anyway.
add missing vars