bug fixed, not finished