Code for the elec5507 project