Imported the initial c# version of libpsinc