fix #20 and started #17