made tweaks to fix bugs