add separate page option
clean up: order function definitions
fix fail