pretty much working code now for name checking