adjusted code to latest updates of nansat