added changes to reduce functions to record more data