library and task 4 bugfixing