wrote table for bottom up approach