Some socket stuff and tiny bit gui stuff