Initial sort of working version