fairly tricky, but technically safe