Add documentation for modal functions and cleaned up syntax a little