added localStorage function but ran out of time to get it working properly.