Moved 'numOfKeywords' to its proper scope

function main() instead of global.