Dynamic position based on Marhu's code