Cleaned up file a bit to remove redundancy.

1st attempt to clean up code a bit, and to add some extra randomness
(rep nop).