some little modifications in the way to print, and var -> val