Cleaned up the code. (issue 34)