made code prettier, slightly more debugging info