Dose simulation

Fixed #36 and #37