Did some bugfixing on the layout transitioning

But it still doesnt work how it should tho....