Fixed few bugs and added code for checking normilize