new update with crane's solution