udated codes for all
adding changes to functions