Add more comments and as.factor for subject and activity