added phase 3 (remote) logic and tests