work on random cos2