added old code which can handle main board