rearranged tests and sped up promise implementation