refactored- sync after each kernel call, remove unnecessary memory allocation (1.44 msec)