broke main into a subfnc