removed foolish rand() stuff