this is the working, slow version - will pick up here tomorrow