added debugging
final bugfixes
final bugfixes