simplified a few lines.