Replaced all write codes with read code