added dynamic allocation for arguments