added some part of the attendance logic