Algorithm improvement. Version is changed to 12