putting functions outside main