some tweaking to main