divide main function and mine sleeper functions
now playing on browser is available
add some TODO comments