working R files for assign2