final version minus unneeded comments