added hamming loss and error in allocated energy