added first function; works fine
added boolean conditional