liborigin with some fixes