working on pid generator