Final version 1, still need to be tested