Fixed Bug xyz

I fixed the bug xyz which causes by a wrong input. Therefore I changed
the function y and inserted some tests.