added serial functions for comm 0, cleaned up some stuff