The code for Version6