shell.c code cleaned up,time loss factor discovered after testing against dash and bash