Removed redundant code, testing some new ideas