starting with script for calculating average ptime