add expand function with until argument; rename some C functions; version bump