Closes #27. Code cleaned up.