Refactored problems 52 & 55