Modified to work with CDF from client