finished router class code