style improvements + several debugs