Rewrite the code now it is done how it should.