added gpu implementation