Replaced read process with Syed's solution