added format function. fixed bug in main.sml. fixed bug in postfix.