Reimplemented position calculation engine for generality