first determine version