+1
some tuning
added cuda versino