Added comments, cleaned up syntax.