finished the main number conversion algorithm. there is a bug in readVal. This needs to be fixed