A new BPM algorithm based on the series expansion method