Updated the code to be better.