main function works a bit