Added a function calculateAgeing