untested uart code
more stuff added, currently broken