final version without framework