some work. adding debug