added from SBo, updated and fixed