Added comments and changed query to follow coding standards