recreated carousel using javascript