complete source code up to end hash calc