ready algorithm