still trying to fix rand