minor tweaks to make it work