Moving the code into an app folder so it works in the browser