Weighted Histogram Analysis Method for free energy calculations