replaced some psuedocode for tests