just implement with some math idea