hw2 serial code