Comments added, final bugfixes