Added use of IsReady function and added some comments