Tidying up code, add cache variables
Start work on front end UI