This was done under the advanced track of data structures and algorithms course CS210.