added subroutine for shell, and one example