added maxprocs set to numcpu and set content length for q1
applied optimizations to q2 and q3 as well