extract is in principle working. but the index handling must be fixed for arrays starting with 1