Added id to distance table, finished up gaussian calculations