implemented addTable functionality