adding changes for #75 and #77