Changed folder architecture and added cuda functions, works with single thread