2* faster but has minor bug