cleaned up and made it run randomly