Added batch and implemeted basic head node functionality