messy cuda implementation of mona