Fixed one bug, still need to fix some others.