Cleaned up with comments