added positioning logic.