fixed the algorithm =D