Code for ELE542 project