earning calculations