adding the 1st version of the dirty messed up code