Changed the field weight to int and modified code to pass all the test cases