more working but not fully using PIL