Changes in preparation for Random GP

As I read through the code necessary to implement the random-GP-stuff, I made some changes to the code to make it better readable, fix some unlogical behavior and remove this weird file called 'xx'. To avoid messing up with the actuak task, I'ld like to merge them now.