fixes #20 #21 #14