optimization
Tests slightly altered