some fixes to my code-Vuk