Added attribute to checbox and some simplifications.