moved encode function to HLA, reconfigured partition size