finished Javascript --> PFA converter