adding all functionality that I have time for. Unfortunatly, the tests do not pass and I do not know how to make it work