working spike. no validity checks added