Restructured OSBoard main to not have inf loop