update comments and pivot logic