fixed function calls to reflect new function names and wrong indentation at simulate_pn for the return call
remove empty lines at the end of the file