Refactored - use islice to calculate exact value