some improvements and additions