Simplified main loop