bacon calculation