i was about to abandon my efforts at the piano when a sudden thought occurred to me and with a wild cry of triumph i replayed the melody that had first opened the portal , but this time i played it in reverse and it took several attempts before i got it right .