fix #12 and some style changes