Save var and add float

Updated to save some variables and use float for Pf rather than int.