Final version for CSCI3171