This seems to work (sometimes not). Still working on it.