complete the mainscreen logic, still need the UI