Adding in Kirill's changes.