Code for ECE 477.