This is an old assignment I wrote for a CSE project.