I understand this code now, thanks @jamiecobbett for explaining.