almost all functionality
All working except write keys and extra fns