added functionality to carousel