added coordinate passing, cleanup