Re-written to avoid regex egg. s-chop added.