partially working code.