Bug fixes, works, now needs command tidy