working version,however some memory and timing tests fails