error calculate

error calculate implemented and some coment of codeblocks
selecting the optimal solution isnt implemented yet.