added button to layout and pseudo java IP script from stack overflow