U930608: Name of some codes are changed. Code for different cost function are seprated