Adding changes that were overlooked in another branch (refactor-precalculus)