now merged and improved