combined 2 files after fixing bug