position calculations working