Optimised parts of the code

randommode is now optimised