fixed all bugs, final