Adding function code to karansFunction