added base count output and fixed coordinate bug