added clone button
parameters to newIndex() JS more sensible