Added code to for testing and reducing the error