fully tested
added SPE support