add compareTo method
[FIXME] add ArrayList
bug fix