finished first version of algorithm part of report