Implementing secorrect function.