fix off by one errors and add modularity_und_sign