Updated functionality of rotate.js