Added availability calculation. Closes #603.