Simplified algorithm