added debug mode for availability calculation