You are using simple `if( length )` below. Why not doing the same for the inverse and using `if( !length )` instead of `=== 0`? This applies to multiple places, use search & replace.