factored gems into calculation