Implementation of the marchenko method