changed format of normalize and added tests