fixed minor bugs in ex5 and ex6

Ex5: In linearRegCosFunction 0 needs to passed as lambda value
Ex6: variables were not updated