Main activity implementation.