PullReqeust for #99 and #63 + logDebugFunction instead of system.out.println