fixed homo calculation, tested