working but not perfectly