fix length normalization
remove length and weight normalizations, fix tf functions