various changes to sub