Final version working 100%