added some functionality for normalization -- not fully tested