First commit for debug

First commit. All bugs are still there. Need to debug then.