This code merges Naoki's most recent code with my most recent code; however it was made mostly by me(Chris)