fixed armor algorithm bug