Merged in erics serial code