added remove sub function