Fixed some equations, added fitting by punishment