fixed getalts and possible problem with random associations