finished add; improved code