tidy up and rewrite cat/slowcat