Refactored problems 81, 82 & 89