Updated with boolean method

both flowchart and javascript
Fixed a space error in the log