Revisited old method, rewrited them in a better fashion to handle more cases and added specs