improved coordinate handling