part1 and part2 rewritten with attention to requirements in the SRS, added part3