corrected formula for 5, thanks to 'imjustjealous'