added grep, tidied up a few bugs and finally got pipes working