Improved adding functionality. Fixed stupid index problem.