Bugfixing and header implementation