first version without bugs