some changes from philippovich a.u.