Writing the pie constructor