restructure of main. mass is set correctly