Fix bug in availability
Addressed issue #79
Address issue #78 + refactor