completed carousel in javascript
removed throw statements