Changed form_name into form_id for the hook functions and shifted some code.