cleaned up spike code