creating function (wrongly way)