constructor builds table