Initial commit from Marat's sources.