fixed bug with confidential functions and added elapsed function