updated from testing code