DB saving implemented but Ive just realised theres a big bug - to fix tomorrow. Starting to add logging