wrote in stats function for B.py. Ready to test with data