added twitter functions and updated main.