Added flex implementation for PAA