Few modifications after getting Keith's help