lots of bugfixing and gcm