tested in emulator. modify details