making progress
overhaul/rewrite, passing tests but not working :(