Modified and added some procedures.