First version working, next step is to package into a class