added changes from pull requres #7