fixed ifs, now worx as follows