added imports to sub function