ret implemented for constant and parameter

Ret implemented for constant and parameter and finalize_code was improved