Adding code from previous work