[#6] fixed errors about arrays links, added function conditionSort so native method sort() could be set working properly, some cosmetic changes