Add some logic and made VM on KO