Attempting to work out digest bug, don't know if this is helping