Is all this if block supposed to go from here to the end?