A technique for the systematic choice of admissible functions in the Rayleigh-Ritz method