finished for 1st version