Almost finish the first version. Not tested yet.