Update MainThread.java

Added more comments and fixed the jumping bug.