update to v0.4
clarify types, mutability, etc.