Improved shell implementation.  Split method can still be more elegant.