making the code more accecible from main()