remove unused code and updated the code to try and match luiggio