inlined some tests and moved loading z lib to bash_profile