Moved stuff around and added rank and message structures.