first version
added better implementation for related functions
added conversion too bool