Finished of computation logic. Works correctly. No detection of mis-behaving agents yet.