localstorage fix, minor simplification of animate code