The big implementation, resume still not debugged.