implementation of cat