minor edits to computations
refactor compilation