add comments, idiot proofing, move hard coded values into parameters