more progress on vapply and tapply lesson