my implementation of code for COMP 482 final project