updated paste to handle generic cases.