finished version without comments