Final(ver1.1)

fixed any valgrind issues