fixing #27 - i messed up with a logic