moved functions to seperate ps1 file