pile calculations