adapted example for remote version