Added calcPosition