Basic random mod implementation. Also some architechture improvements.