ex3 - ls cost func done