Update main.js

Adding convertToK