improved skill gaining algorithm