Corner case logic for very large dose is added. Needs testing.