fix rand index and update architecture