Added cast to int, needed on my gpu