slight code tweaks