logelei-2 adapted to new functions