added tweaks and corrections