addapted code to work with Bootstrap 3 markup