added setup, fixed template bug, made order optional