final version: fixed some minor bugs