added p3.1

still need to finish the batch function