tile constructor function