Scripting for real

Import for pgpin is a bit wierd, but otherwise works well.