added another constructor, fixed erase bug