Removed arrays;  completed add function