Changes to use localStorage