Flexibility algorithm for Akin Programming Language