Fixed error in parser logic
Dont advance position if symbol has already been found
sprintf like JSON formatting function added