added Sophias improvements and corrections