added root mean squre cost function