code for generating set of platforms- does not work correctly yet