Used for the hw4 assignment