added ptarray test program
fixed some concurrency bugs
minor