some errors fixed, more debugging