Add logical is not function

Fix append mode

Use logical partial function instead of lambda

Add docstring