reordered operations
updated documentation