added miguel+quality algorithm