Replace which with hash, formatting