merge of our works. not finished yet.