Adding changes related to #30 and #24