added wrap function