first version, solved assignment