fixed issue #10 and added some smartypants features