This needs a separate thread-Mark Williams