Removing unnecessary code and adding bar selection.