improved kernel + added cpu function; test now tests and compares speed